<div class="menu-trai">
    <div class="t-menu"><?php echo $heading_title; ?></div>
    <div class="mn-trai">
        <ul>
            <?php foreach ($categories as $category) { ?>
            <li class="li-mn">
                <a href="<?php echo $category['href']; ?>"
                   class="a-mn <?php if ($category['category_id'] == $category_id) { echo "active";} ?>"
                                                                              <span class="nm-title"><?php echo $category['name']; ?></span>
                       <span class="caret caret-t"></span>
                   </a>
                   <?php if ($category['children']) { ?>
                   <ul>
                       <li>
                           <div class="box-menu">
                               <ul class="menu-con">
                                   <!--<li><a href="#" class="a-title">Computers</a></li>-->
                                   <?php foreach ($category['children'] as $child) { ?>
                                   <li class="li-con">
                                       <a href="<?php echo $child['href']; ?>"
                                          class="nm-title <?php if ($child['category_id'] == $child_id) {
                                              echo "active";}?>">
                                              <?php echo $child['name']; ?>
                                       </a>
                                   </li>
                                   <?php } ?>
                               </ul>
                           </div>
                       </li>
                   </ul>
                   <?php } ?>
                </li>
                <?php } ?>
            </ul>
        </div>
    </div>